import datetime,os,json,requests
money=200
res=requests.get('http://127.0.0.1:5000/course/sendmoney?money=%d'%money)
mes=json.loads(res.text)
flag='通过'
if mes['code']!=200:
    flag='不通过'
reportmes={'Url':'http://127.0.0.1:5000/course/sendmoney?money=200','请求方式':'get','请求参数':money,'返回结果':mes,'测试结果':flag}
filename=datetime.datetime.strftime(datetime.datetime.now(),'%Y-%m-%d')
with open(os.path.join('../logs/'+filename+'.txt'),'w',encoding='GBK') as f:
    f.write(json.dumps(reportmes,ensure_ascii=False))